<?php
class UserModel extends Model{
	private $user_id;
	private $user_name;
	private $user_img;
	public function __set($n,$v){
		$this->$n=$v;
	}
	//添加用户
	public function insert(){
		$query="insert into daka_user values (null,'{$this->user_name}','{$this->user_img}')";		
	    $res=$this->db->_query($query);
	    return $res;
	}
	//显示所有用户
	public function searchUser(){
		$query="select * from daka_user";
		$this->db->_query($query);
		$rows=$this->db->getAll();
		return $rows;
	}
	//判断用户合法
	public function check_login(){
		$query="select * from daka_user where user_name='{$this->user_name}'";
		$this->db->_query($query);
		$res=$this->db->getRow();
		return $res;
	}
}